package com.molichuxing.services.property;

/**
 * 
 * @author liyg 库类型枚举类
 *
 */
public enum StockCarStockTypeEnum {

	/**
	 * 中转库
	 */
	ENTREPOT_STORAGE(1, "中转库"),
	
	/**
	 * 门店
	 */
	STORE(2, "门店");

	
	int value;
	String name;

	StockCarStockTypeEnum(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}


	/**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
	public static String getName(int value) {
		StockCarStockTypeEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
	}

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static StockCarStockTypeEnum getEnum(int value) {
		for (StockCarStockTypeEnum enumerate : StockCarStockTypeEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}
}
